<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
      
	<h:head>
		<link rel="shortcut icon" type="image/x-icon" href="#{request.contextPath}/resources/ico/favicon.ico"/>
		<title>Hospital Universitário/UFPI/EBSERH - <ui:insert name="title">Home</ui:insert></title>
		
		<h:outputStylesheet library="css" name="default.css"/>
		<h:outputStylesheet library="css" name="form.css"/>
		<h:outputStylesheet library="css" name="logon.css"/>
		
	</h:head>
	
<h:body>
	
	<f:facet name="last">
		<h:outputStylesheet library="css" name="primefaces_override.css" />
	</f:facet>
	
<div class="main">
		<div class="top">
			<div class="header">
				
				<div class="box_search_links">
					<div id="ebserh">
					</div>
					<div class="links">
						<h:form>
							<h:outputText value="#{msgs.loginHello} #{userMB.user.login}"/>
							<h:outputText value="&nbsp;|&nbsp;"/>
							
							<h:graphicImage library="img" name="home.png"/><h:commandLink action="pacientes" value="#{msgs.home}"/>&nbsp;|&nbsp;							
							<h:commandLink action="#{administracaoMB.atualizarTabela()}" value="#{msgs.administracao}" rendered="#{userMB.isUserAdmin()}"/>
							<h:outputText value="&nbsp;|&nbsp;" rendered="#{userMB.isUserAdmin()}"/>
							
							<h:commandLink action="#{userMB.atualizarDados()}" value="#{msgs.atualizarDados}" immediate="true"/>&nbsp;|&nbsp; 
							<h:graphicImage library="img" name="chamados.png"/><h:commandLink action="#{relatoriosMB.listar()}" value="#{msgs.gerados}"/>&nbsp;|&nbsp;
							
							<a href="#"><h:graphicImage library="img" name="favorito.png"/>Favorito</a>&nbsp;|&nbsp;
							<a href="#"><h:graphicImage library="img" name="mapa.png"/>Mapa</a>&nbsp;|&nbsp;
							
							<h:commandLink action="#{userMB.logOut()}" value="#{msgs.logout}" immediate="true" rendered="#{request.userPrincipal != null}"/>
						</h:form>
					</div>
				</div>
			</div>
		</div>
		<div id="wrapper">	
		   
		    <div class="content">
		    	<p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();" />

				<p:dialog modal="true" widgetVar="statusDialog" header="Carregando" draggable="false" closable="false">
					<p:graphicImage value="/resources/img/ajaxloadingbar.gif" />
				</p:dialog>

<!--
				<h:messages globalOnly="true" infoClass="info" errorClass="error"
					warnClass="warn" fatalClass="fatal" />
-->
					
				<p:messages id="msgs" showDetail="false" autoUpdate="true" closable="true"/>
				
				<ui:insert name="no_form"></ui:insert>
				
				<h:form id="main_form">
					<ui:insert name="main"></ui:insert>
				</h:form>
	        </div>
	    </div>
	    <div class="footer">
	    	Copyright 2013 lrs
	    </div>
    </div>
</h:body>
</html>